// dependencies.js
import React, { createContext, useContext } from 'react'
import { SpMessage } from 'simple-message-toast'

const SpMessageContext = createContext()

export const SpMessageProvider = ({ children }) => {
  const spMessage = new SpMessage()

  return (
    <SpMessageContext.Provider value={spMessage}>
      {children}
    </SpMessageContext.Provider>
  )
}

export const useSpMessage = () => {
  return useContext(SpMessageContext)
}
